Notes on Kate's Email.
The Email
Hi Sudhir,
I have attached a version of the example that runs. However, the results are not very interesting given the small size of the example. You should be able to scale this up to your application. The main issue are as follows:
- The example has only 1 scenario (this may be a result of sharing a small example) – With 1 scenario, only 1 sensor will be selected to minimize detection time or cover the scenario. With scenario-time coverage, you could get additional sensors placed, but in this case the sensors all detect about the same information (given the very low threshold, it looks like they all detect about the same timesteps).
- Some potential sensor locations do not have signal data (this may be a result of sharing a small example). I see 3 unique Nodes in signals and 6 potential sensor locations. This means that 3 locations will never be selected in the optimization.
- The budget should be in the same units as sensor cost. I see that each sensor costs 100, but the budget is 14934621000. This means that optimization will try to place all sensors. If you set the budget to a smaller value (for example, budget=200 will try to place 2 sensors in this example since they all cost the same amount). That said, this example will only select 1 sensor due to #1.
- The threshold is higher than all values in signals[‘S1’], which means that a sensor at any of those locations will detect the entire signal. I’m not sure if that’s intentional. The sensor threshold and signal should be in the same units.
- The Undetected Impact is set to 100 for scenario S1. This is lower than any T in signals. That means that it’s better to not detect S1 and place no sensors when using the impact formulation. I have updated Undetected Impact to be higher than the max time.
- There is no issue using large times. The issue was the very high value for budget and very low value for undetected impact.
Keep in mind that optimization is most useful when the number of scenarios is much larger than the number of sensors, and certain sensors are better at detecting certain scenarios (the detection is not equal). Generally, the budget is set such that you can’t pick all the sensors to detect all the scenarios. That forces the optimization to choose the best combination, knowing that some scenarios (or scenario-time pairs) will go undetected,
I updated the code and included comments. Hope that helps!
Kate
The ticket
A ticket has been created in APTIM Chama # 22
The Code
Kate left notes in her code as I read through the code to find out what she changed I will be adding notes to this section. I wil also be checking Chama documentation based on the findings and see if what Kate has told us is in there.
- Scenario File
- Probability should be between 0 and 1. (This is not explicitly stated in the docs but the example shown does have probability in this range).
- When minimizing detection time Undetected Impact is in units of T from the signal file. In this case it is Timestamp. It should also reflect the penalty for not detecting an impact. So since we had an Undetected Impact of 100 when our units are in timestamp and the first timestamp in the signals file is 1493448900 the value was too low this apparently will result in no sensors being selected. In her example Kate set the sensor to 2 times the max unix timestamp.
- It is easier to read the timesteps rather than
- Sensor File
- Only 3 of our 6 sensors had any signal(This was known but we cannot expect all sensors to get data. So we did not bother to change this.)
- The sensor Budget should be same units as sensor cost. Just because the budget is large enough to allow multiple sensors does not mean that multiple sensors will be chosen.
- TODO Set the sensor cost to 1 and the sensor budget to the number of sensors on hand.
- Since 1 signal is higher than the other 2 she thinks the threshold should be higher to weed out signals. Which would be great for her if we were trying to prove the usefulness of chama but we are not. There are reasons that the threshold is low. The stuff we are modeling is bad and we need to detect it even in small amounts.